.com
Hosted by:
Unit testing expertise at your fingertips!
Home | Discuss | Lists

Introduce Parameter

The book has now been published and the content of this chapter has likely changed substanstially.

A value used inside a method needs to be passed as a parameter.

The Introduce Parameter refactoring is used to add a parameter in a method declaration if you need some value to be passed in a method call. The method usage(s) are changed also. References to the parameter are resolved unlike in the Change Method Signature refactoring (where an introduced statement is simply inserted as text).

From [JBrains].

Further Reading

http://www.jetbrains.com/idea/docs/help/refactoring/introducefield.html

Page generated at Wed Feb 09 16:39:04 +1100 2011

Copyright © 2003-2008 Gerard Meszaros all rights reserved

All Categories
Introductory Narratives
Web Site Instructions
Code Refactorings
Database Patterns
DfT Patterns
External Patterns
Fixture Setup Patterns
Fixture Teardown Patterns
Front Matter
Glossary
Misc
References
Result Verification Patterns
Sidebars
Terminology
Test Double Patterns
Test Organization
Test Refactorings
Test Smells
Test Strategy
Tools
Value Patterns
XUnit Basics
xUnit Members
All "Code Refactorings"
Extract Class
Extract Implementer
Extract Interface
Extract Method
Extract Superclass
Inline Method
Inline Temp
Introduce Explaining Variable
Introduce Field
Introduce Local Extension
Introduce Parameter
Move Field
Move Method
Preserve Whole Object
Pull Up Field
Pull Up Method
Rename Method
Replace Conditional With Guard Clause
Replace Magic Number with Symbolic Constant
Replace Nested Conditional with Guard Clauses
Sprout Class